#pragma once
#include "cocos2d.h"
#include <string>
class GameLayer;
class SpriteStatebar:public cocos2d::CCSprite
{
public:
	SpriteStatebar(void);
	~SpriteStatebar(void);
	static SpriteStatebar *node(GameLayer *pLayer);
	void addSafecap(int nAdd);
	void addArmorNum(int nAdd);
	void addGhostNum(int nAdd);
protected:
	virtual bool init(GameLayer *pLayer); 
	bool addBar();
private:
	enum BAR_TAG{BAR_SAFECAP=0,BAR_ARMOR,BAR_GHOST,TAG_MENU};
	void menuSafecap(cocos2d::CCObject *pObj);
	void menuArmor(cocos2d::CCObject *pObj);
	void menuGhost(cocos2d::CCObject *pObj);
	void addItem(const std::string strArray[],int nArrayNum, int nValue,BAR_TAG barTag,const cocos2d::SEL_MenuHandler &menuHandle);
	void setLableString(BAR_TAG barTag,int nValue);
	int nSafecapNum_;
	int nArmorNum_;
	int nGhostNum_;
	cocos2d::CCArray *lableArray_;
	GameLayer *pGamePlayer_;
	
	

};
